package com.tct.smartRE.fwk.impl.dao;

import java.util.List;

import com.tct.smartRE.fwk.api.IQueryCondition;

public class QueryConditionTemplate implements IQueryCondition {

	public Integer getFirstResult() {
		return null;
	}

	public Integer getMaxResult() {
		return null;
	}

	public List<Object> getParams() {
		return null;
	}

	public String getQuery() {
		return null;
	}

	public static IQueryCondition createQuery(final String sqlQuery) {
		return new QueryConditionTemplate() {
			@Override
			public String getQuery() {
				return sqlQuery;
			}

		};
	}
	
	public static IQueryCondition createQuery(final String sqlQuery, final List<Object> sqlParam) {
		return new QueryConditionTemplate() {
			@Override
			public String getQuery() {
				return sqlQuery;
			}

			@Override
			public List<Object> getParams() {
				return sqlParam;
			}

		};
	}

	public static IQueryCondition createQuery(final String sqlQuery,final List<Object> sqlParam, final Integer firstResult) {
		return new QueryConditionTemplate() {
			@Override
			public String getQuery() {
				return sqlQuery;
			}

			@Override
			public List<Object> getParams() {
				return sqlParam;
			}
			
			@Override
			public Integer getFirstResult() {
				return firstResult;
			}
			
		};
	}
	
	public static IQueryCondition createQuery(final String sqlQuery,final List<Object> sqlParam, final Integer firstResult, final Integer maxResult) {
		return new QueryConditionTemplate() {
			@Override
			public String getQuery() {
				return sqlQuery;
			}

			@Override
			public List<Object> getParams() {
				return sqlParam;
			}
			
			@Override
			public Integer getFirstResult() {
				return firstResult;
			}
			
			@Override
			public Integer getMaxResult() {
				return maxResult;
			}

		};
	}

}
